package com.molichuxing.services.property;

/**
 * @Author: zhaopenghui
 * @Description:
 * @Date: Created in 11:27 2020/08/28
 * @Modified By:
 **/
public enum StatisticsAssetRentalTypeEnum {
    /**
     * 全款买断
     */
    FULL_BUY_OUT(21, "全款买断"),
    /**
     * 运营车辆
     */
    OPERATING_VEHICLE(22, "运营车辆"),
    /**
     * 回退车辆
     */
    ROLLBACK_VEHICLE(23, "回退车辆"),
    /**
     * 逾期及特殊
     */
    OVERDUE_AND_SPECIAL(24, "逾期及特殊");

    int value;
    String name;

    StatisticsAssetRentalTypeEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }


    /**
     * 通过value获取枚举的name
     *
     * @param value
     * @return
     */
    public static String getName(int value) {
        StatisticsAssetRentalTypeEnum enumerate = getEnum(value);
        return enumerate == null ? null : enumerate.getName();
    }

    /**
     * 通过value获取枚举
     *
     * @param value
     * @return
     */
    public static StatisticsAssetRentalTypeEnum getEnum(int value) {
        for (StatisticsAssetRentalTypeEnum enumerate : StatisticsAssetRentalTypeEnum.values()) {
            if (enumerate.getValue() == value) {
                return enumerate;
            }
        }
        return null;
    }

}
